//
//  LZVideoDetailAddressAndIphoneCell.m
//  LzzizDemo
//
//  Created by xbnzd on 16/11/3.
//  Copyright © 2016年 xbnzd. All rights reserved.
//

#import "LZVideoDetailAddressAndIphoneCell.h"
#import "UIView+Rotation.h"
#import "GiftListLabel.h"

@interface LZVideoDetailAddressAndIphoneCell()
@property (weak, nonatomic) IBOutlet UIImageView *cellIcon;
@property (weak, nonatomic) IBOutlet GiftListLabel *contentLabel;
@property (weak, nonatomic) IBOutlet UIImageView *imageArrow;


@end

@implementation LZVideoDetailAddressAndIphoneCell

- (void)awakeFromNib {
    [super awakeFromNib];
    [self configureLabel];
    [self.imageArrow setLanguageRotaion];
    // Initialization code
}

- (void)loadLabelText:(NSString *)text CellIcon:(UIImage *)icon
{
    self.contentLabel.preferredMaxLayoutWidth = SCREEN_WIDTH - 46 - icon.size.width;
    [self setContentLabelLabelText:text];
    self.cellIcon.image = icon;
}

- (void)setContentLabelLabelText:(NSString *)text
{
    if (text.length <= 0) {
        return ;
    }
    extern CGFloat textLineSpace;
    NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc] initWithString:text];
    NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
    
    [style setLineSpacing:textLineSpace];
    [style setLineBreakMode:NSLineBreakByWordWrapping];
    [style setAlignment:NSTextAlignmentLeft];
    
    [attStr addAttribute:NSParagraphStyleAttributeName value:style range:NSMakeRange(0, attStr.length)];
    self.contentLabel.attributedText = attStr;
    
}

#pragma mark -
#pragma mark configure label
- (void)configureLabel
{
    [self.contentLabel setVerticalAlignment:VerticalAlignmentTop];
}




- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
